function HandleHistoryMailInformation(gui, operator, now, options) {
  this._gui = gui;
  this._operator = operator;
  this._now = now;
  this._options = options;
  
  this._produceId = (options && options.p) ? options.p : null;
  this._popupBox = new PopupBox();
  this._popupBox2 = new PopupBox2();
  
  this._createElements();
};

HandleHistoryMailInformation.prototype._createElements = function() {
  this._loadData();
};

HandleHistoryMailInformation.prototype._verifyData = function() {
  if (this._produce) {
    this._updateElements();
  }
};

HandleHistoryMailInformation.prototype._loadData = function() {
  this._produce = null;
  
  this._retrieveProduces();
};

HandleHistoryMailInformation.prototype._retrieveProduces = function() {
  var _self = this;
//  new RequestUtils()._read('produce', null, 'd.oid = \'' + this._produceId + '\'', null, null, null, null, function(result, params) { _self._produce = (result.data.length == 1) ? result.data[0] : null;
//                                                                                                                                      _self._verifyData.call(_self);
//                                                                                                                                    }, { php: Constant.FACTORY + '/jsonread.php' });
  var joins = '&selects=0' + '&purchaseitems=0' + '&preconusers=0' + '&events=0' + '&tracks=0' + '&produces=1' + '&notes=0';
  var args = '&c=d.e_oid = \'' + this._produceId + '\'' + joins;
  new RequestUtils()._mysql('produce', args, function(result, params) { _self._produce = (result.data.length == 1) ? result.data[0] : Produce.instance();
                                                                        _self._verifyData.call(_self);
                                                                      }, { php: 'customphp/produceread.php'});
  
};

HandleHistoryMailInformation.prototype._updateElements = function() {
  var _self = this;
  DlmanageUtils.clear(this._gui);
  var smryGui = GuiSmryFactory.instance();
  if (smryGui && smryGui.jobs) {
    var smryArgs = [ { name: smryGui.jobs.id, cond: DlmanageUtils.factoryTasks },
                     { name: smryGui.sends.id, cond: DlmanageUtils.factorySend },
                     { name: smryGui.parcels.id, cond: DlmanageUtils.factoryParcels }
                   ];
    new HandleSmry(smryGui, null, { args: smryArgs });
  }
  this._gui.cancel.onclick = function() { history.back(); };
  
  this._memo = {};
  this._gui.memo.onclick = function() { var pos = DOMUtils.findPos(this);
                                        var div = document.createElement('div');
                                        var func1 = function() { _self._produce.review = _self._memo._text;
                                                                 new RequestUtils()._write('produce', [_self._produce], [], function() { _self._retrieveProduces.call(_self); }, {php: Constant.FACTORY + '/customphp/mysqlwrite.php', pos: pos });
                                                                 _self._popupBox2._close();
                                                               };
                                        var func2 = function() { _self._popupBox2._close(); };
                                        MiscUtils.dialog(_self._popupBox2, pos, div, func1, func2, {t: 'REVIEW'});
                                        new DialogInput(div, _self._memo, { title: '', default: _self._produce.review });
                                      }
  
  this._gui.mailNumber.appendChild(document.createTextNode(this._produce.code));
  this._gui.person.appendChild(document.createTextNode(this._produce.receiver));
  
  this._gui.sendTime.appendChild(document.createTextNode(SimpleDate.format(this._produce.sentDate)));
  this._gui.receiveTime.appendChild(document.createTextNode((this._produce.receivedDate) ? SimpleDate.format(this._produce.receivedDate) : ''));
  
  this._gui.address.appendChild(document.createTextNode(this._produce.address));
  this._gui.mailNo.appendChild(document.createTextNode(this._produce.code));
  this._gui.company.appendChild(document.createTextNode(this._produce.company));
  this._gui.weight.appendChild(document.createTextNode(this._produce.weight));
  this._gui.comment.appendChild(document.createTextNode(this._produce.comment));
  this._gui.review.appendChild(document.createTextNode((this._produce.review) ? this._produce.review : ''));
  
  new TableProducts(this._gui.products, this._produce.v2_produces, { user: this._operator, date: this._now, callbackFunc: function() { _self._updateElements.call(_self); } });
};